<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <body>

        <ui:composition template="./Test.xhtml">


            <ui:define name="content">


                <fieldset style="height: 700px">
                    <legend><b>Update Admin</b></legend>


                    <center> <table width="716" height="513">
                            <tr>
                                <td><h2>Update Admin!</h2></td>
                            </tr>

                            <tr>
                                <td height="47"><b>User Name *</b></td>
                                <td><p:inputText value="#{adminBean.selectedAdmin.userName}"/></td>
                                <td></td>
                            </tr>

                            <tr>
                                <td height="45"><b>Password *</b> </td>
                                <td><p:password feedback="true" minLength="6" value="#{adminBean.selectedAdmin.password}" id="txtpassword" required="true" requiredMessage="Password is not null"/></td>
                                <td></td>
                            </tr>

                            <tr>
                                <td height="45"><b>Full Name *</b> </td>
                                <td><p:inputText value="#{adminBean.selectedAdmin.fullName}" id="txtfullName" required="true" requiredMessage="FullName is not null">
                                        <f:validator validatorId="Validator.StringValidator"/>
                                    </p:inputText>
                                </td>
                                <td>
                                    <p:message for="txtfullName"/></td>
                            </tr>

                            <tr>
                                <td height="45"><b>Phones *</b></td>
                                <td><p:inputText value="#{adminBean.selectedAdmin.phone}" id="txtphone" required="true" requiredMessage="Phone is not null">
                                        <f:validator validatorId="Validator.PhoneValidator"/>
                                    </p:inputText>
                                </td>
                                <td>
                                    <p:message for="txtphone"/></td>
                            </tr>

                            <tr>
                                <td height="45"><b>Address *</b></td>
                                <td><p:editor value="#{adminBean.selectedAdmin.address}" id="txtaddress" required="true" requiredMessage="Address is not null"/>  </td>
                                <td>
                                    <p:message for="txtaddress"/></td>
                            </tr>
                            <tr>
                                <td height="61"><b>Email *</b></td>
                                <td><p:inputText value="#{adminBean.selectedAdmin.email}" id="txtemail" required="true" requiredMessage="Email is not null">
                                        <f:validator validatorId="Validator.EmailValidator"/></p:inputText>
                                </td>
                                <td><p:message for="txtemail"/></td>
                            </tr>

                            <tr>
                                <td height="45"><b>Birthday *</b></td>
                                <td><p:calendar value="#{adminBean.selectedAdmin.birthday}" id="txtbirthday" required="true" requiredMessage="Birthday is not null"/>  </td>
                                <td>
                                    <p:message for="txtbirthday"/></td>
                            </tr>
                            <tr>
                                <td height="65"></td>
                                <td>
                                    <h:commandButton value="Update" action="AdminHome" actionListener="#{adminBean.updateAdmin}" type="image" image="../resources/images/forms/form_submit.gif">

                                    </h:commandButton>
                                    <h:commandButton value="Cancel" action="AdminHome" type="image" image="../resources/images/forms/form_reset.gif"/>



                                </td>
                                <td></td>
                            </tr>
                        </table>
                    </center>

                </fieldset>




            </ui:define>



        </ui:composition>

    </body>
</html>
